<ul class="toollist">
    <li onclick="addTab('服务中订单', '/orders/inservice');">
        <div class="listbox"><i class="iconfont icon-asset-management-the-asset-summary"></i><em><?php echo $inserviceNum;?><p>服务中订单</p></em></div>
    </li>
    <li onclick="addTab('待结算订单', '/orders/settlement');">
        <div class="listbox"><i class="iconfont icon-GIS-TL_weixiudian-"></i><em><?php echo $settlementNum;?><p>待结算订单</p></em></div>
    </li>
    <li onclick="addTab('已结算订单', '/orders/settled');">
        <div class="listbox"><i class="iconfont icon-ERP_huokuanzongjine"></i><em><?php echo $settledNum;?><p>已结算订单</p></em></div>
    </li>
    <li onclick="addTab('员工管理', '/members/index');">
        <div class="listbox"><i class="iconfont icon-fuquanshenpi_jiaodian"></i><em><?php echo $memsNum;?><p>员工总数</p></em></div>
    </li>
</ul>

<ul class="chartlist" style="display: flex;">
    <li>
        <div class="chartbox">
            <div class="boxtitle"><span>日订单统计</span><a href="#">更多<i class="iconfont icon-gengduo"></i></a></div>
            <div id="chart2" class="charts"></div>

            <script type="text/javascript">
                // 基于准备好的dom，初始化echarts实例
                var myChart1 = echarts.init(document.getElementById('chart2'), 'uimaker');
                // 指定图表的配置项和数据
                option = {

                    calculable: true,
                    xAxis: [
                        {
                            type: 'category',
                            boundaryGap: false,
                            data:  JSON.parse('<?php echo $days; ?>')
                        }
                    ],

                    grid: {
                        x: 60,
                        x2: 40,
                        y: 10,
                        height: 140
                    },
                    yAxis: [
                        {
                            type: 'value'
                        }
                    ],
                    series: [
                        {
                            name: '成交',
                            type: 'line',
                            smooth: true,
                            itemStyle: {normal: {areaStyle: {type: 'default'}}},
                            data: JSON.parse('<?php echo $daysVals; ?>')
                        }
                    ]
                };

                // 使用刚指定的配置项和数据显示图表。
                myChart1.setOption(option);
                window.addEventListener("resize", function () {
                    myChart1.resize();
                });
            </script>

        </div>
    </li>

    <li>
        <div class="chartbox">
            <div class="boxtitle"><span>月订单统计</span><a href="#">更多<i class="iconfont icon-gengduo"></i></a></div>
            <div id="chart3" class="charts"></div>

            <script type="text/javascript">
                // 基于准备好的dom，初始化echarts实例
                var myChart2 = echarts.init(document.getElementById('chart3'), 'uimaker');

                // 指定图表的配置项和数据

                option = {
                    tooltip: {
                        trigger: 'item',
                        textStyle: {fontSize: 14},
                        axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                            type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                        }
                    },

                    grid: {
                        x: 60,
                        x2: 40,
                        y: 10,
                        height: 140
                    },
                    calculable: true,
                    xAxis: [
                        {
                            type: 'category',
                            data: JSON.parse('<?php echo $month; ?>')
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value'
                        }
                    ],
                    series: [
                        {
                            name: '订单数量',
                            type: 'bar',
                            data: JSON.parse('<?php echo $monthVals; ?>')
                        }
                    ]
                };
                // 使用刚指定的配置项和数据显示图表。
                myChart2.setOption(option);
                window.addEventListener("resize", function () {
                    myChart2.resize();
                });
            </script>

        </div>
    </li>

    <li></li>
</ul>

<div class="infolist">

    <div class="infoleft">
        <div class="infoboxleft">
            <div class="boxtitle"><span>最新订单</span><a href="#">更多<i class="iconfont icon-gengduo"></i></a></div>

            <div class="boxdown">
                <table class="simpletable">
                    <thead>
                    <th>订单编号</th>
                    <th>车检站</th>
                    <th>客户</th>
                    <th>订单金额(元)</th>
                    <th>状态</th>
                    <th>下单时间</th>
                    </thead>
                    <tbody>
                    <?php foreach($orders as $k=>$v):?>
                    <tr>
                        <td><?php echo $v->order_no;?></td>
                        <td><?php echo $v->company->name;?></td>
                        <td><?php echo $v->customer->username;?></td>
                        <td><?php echo $v->amount;?></td>
                        <td><?php echo $v->statusName;?></td>
                        <td><?php echo $v->created_at;?></td>
                    </tr>
                    <?php endforeach;?>
                    </tbody>
                </table>
            </div>

        </div>
    </div>

    <div class="inforight"></div>
</div>
<script>
    $(window).resize();
</script>
